package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo2 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        map.put("语文",99);
        map.put("数学",100);
        map.put("英语",70);
        map.put("物理",100);
        System.out.println(map);
        Integer value = map.get("语文");
        System.out.println(value);
        value = map.get("生物");
        System.out.println(value);
        System.out.println("map的大小为"+map.size());
        System.out.println("map是否为空集"+map.isEmpty());
        System.out.println("map是否包含某个键"+map.containsKey("数学"));
        System.out.println("map是否包含某个值"+map.containsValue(67));
        map.remove("物理");
        System.out.println(map);
        map.remove(100);
        System.out.println(map);
        map.clear();
        System.out.println(map);
    }
}
